#ifndef DEFERRED_SHADING_SAMPLE_H
#define DEFERRED_SHADING_SAMPLE_H
#include "SampleBase.h"
#include "plane.h"
#include "Quad.h"
#include "objmesh.h"
#include "glslprogram.h"
#include <glm\glm.hpp>
using glm::vec3;
using glm::vec4;
using glm::mat4;
using glm::mat3;
namespace ShaderLab {
	class DefferdShadeSample : public SampleBase {
	public:
		DefferdShadeSample();
		~DefferdShadeSample();

		void Init();
		void Update(float time);
		void Render();
		void Imgui();
		void ShutDown();
	private:
		void UpdateMatrices();
		void CreateShader();
		void FBO();
		void GBuffer(GLenum, GLenum, GLuint &);
		void Pass1();
		void Pass2();
	private:
		GLSLProgram prog;
		GLuint deferredFBO;
		std::unique_ptr<Quad> ScreenQuad;
		std::unique_ptr<Plane> floor;
		std::unique_ptr<ObjMesh> mesh;
		mat4 model, view, projection;
		GLuint posTex, normTex, colorTex;
	};
}
#endif // !TEMPLATE_SAMPLE_H
